package cn.iocoder.yudao.module.team.dal.mysql.line;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.team.dal.dataobject.line.LineDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.team.controller.admin.line.vo.*;

/**
 * 线路 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface LineMapper extends BaseMapperX<LineDO> {

    default PageResult<LineDO> selectPage(LinePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<LineDO>()
                .likeIfPresent(LineDO::getName, reqVO.getName())
                .eqIfPresent(LineDO::getNameLin, reqVO.getNameLin())
                .eqIfPresent(LineDO::getType, reqVO.getType())
                .eqIfPresent(LineDO::getNumber, reqVO.getNumber())
                .eqIfPresent(LineDO::getDays, reqVO.getDays())
                .eqIfPresent(LineDO::getSort, reqVO.getSort())
                .eqIfPresent(LineDO::getRemarkStay, reqVO.getRemarkStay())
                .eqIfPresent(LineDO::getAttention, reqVO.getAttention())
                .eqIfPresent(LineDO::getIsEffective, reqVO.getIsEffective())
                .eqIfPresent(LineDO::getRemak, reqVO.getRemak())
                .eqIfPresent(LineDO::getBreakst, reqVO.getBreakst())
                .eqIfPresent(LineDO::getIsSingle, reqVO.getIsSingle())
                .eqIfPresent(LineDO::getColumn1, reqVO.getColumn1())
                .eqIfPresent(LineDO::getColumn2, reqVO.getColumn2())
                .eqIfPresent(LineDO::getColumn3, reqVO.getColumn3())
                .eqIfPresent(LineDO::getColumn4, reqVO.getColumn4())
                .eqIfPresent(LineDO::getColumn5, reqVO.getColumn5())
                .betweenIfPresent(LineDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(LineDO::getId));
    }

}